package org.whusim.utils;

import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;

/**
 * 生成过滤后的docList
 * 
 * @author Qiwang 2012-6-5下午08:53:38
 */
public class TempdocListGenerator {


	Set<String> docIdSet = new HashSet<String>();
	
	public TempdocListGenerator(Set<String> docIdSet) {
		super();
		this.docIdSet = docIdSet;
	}

	public void filterDocList(String filePath) {

		File file = new File(filePath);
		String line = "";
		StringBuilder sb = new StringBuilder();
		String[] package_DocId = new String[6];
		try {
			BufferedReader br = new BufferedReader(new InputStreamReader(
					new FileInputStream(file)));
			while ((line = br.readLine()) != null) {
				package_DocId = line.split(" ");
				String docId = package_DocId[2].trim();
				docIdSet.add(docId);
				System.out.println(line + "\n");

			}
		} catch (FileNotFoundException e) {
			e.printStackTrace();
		} catch (IOException e) {
			e.printStackTrace();
		}

	}

}
